{% load display_tags %}

{% if format == "HTML" %}
    {% with images=obj|file_images %}
        <h6>Images</h6>
        {% for pic in images %}
            <p><img src="{{ host }}{% pic_token pic size %}" style="max-width: 85%" alt="Finding Image"></p>
        {% empty %}
            <p class="text-center">No images found.</p>
        {% endfor %}
    {% endwith %}
{% elif format == "INLINE" %}
    {% with images=obj|file_images %}
        <h6>Images</h6>
        {% for pic in images %}
            <p><img src="{{ pic|inline_image }}" style="max-width: 85%" alt="Finding Image"></p>
        {% empty %}
            <p class="text-center">No images found.</p>
        {% endfor %}
    {% endwith %}
{% else %}
    {% with images=obj|file_images %}
        {% for pic in images %}
            image::{{ request.scheme }}://{{ request.get_host }}{% pic_token pic size %}[] +<br>
        {% empty %}
            No images found.
        {% endfor %}
    {% endwith %}
{% endif %}
